<%--
  Created by IntelliJ IDEA.
  User: hklyq
  Date: 2019-03-01
  Time: 16:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>查看诉讼记录资料</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <form id="formSet1">
        <div class="fieldset1 tabel_col clearFix">
            <div class="sqPanel_body">
                <div id="sueBscInfoFileCfgGrid" class="sq-grid"></div>
            </div>
        </div>
    </form>
</div>


<script type="text/javascript">
    var sueBscInfoFileCfgGrid = null;
    var id = '${id}';
    $(function () {
        //项目资料Grid
        sueBscInfoFileCfgGrid = $("#sueBscInfoFileCfgGrid").ligerGrid({
            url: '<%=path%>/sue/sueBscInfo/initSueBscInfoFileCfgGrid.do?id=' + id,
            method: 'get',
            columns: [
                {display: '资料名称', name: 'datNm', align: 'center', minWidth: 100, enabledSort: false},
                {
                    display: '上传文件名称', name: 'fileNm', minWidth: 100, enabledSort: false,
                    render: function (rowdata, rowindex, value) {
                        if (value) {
                            var h;
                            h = '<a href="javascript:uploadFileByUrl(';
                            h += "'" + rowdata.filePath + "'";
                            h += ",'" + rowdata.fileNm + "'";
                            h += ')">' + rowdata.fileNm + '</a>'
                            return h;
                        }
                    }
                },
                {display: '上传时间', name: 'crtTm', align: 'center', minWidth: 100, enabledSort: false, render: renderDate},
                {display: '上传用户', name: 'upUsrNm', width: 100, enabledSort: false,
                    render: function (rowdata, rowindex, value) {
                        if (null != rowdata.fileId && '' != rowdata.fileId) {
                            return rowdata.upUsrNm;
                        }
                    }
                }
            ],
            root: 'rows',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            isScroll: false,
            rownumbers: true,  //显示序号
            checkbox: false,
            allowUnSelectRow: true,
            alternatingRow: false,
            frozen: false,
            usePager: false,
            onAfterShowData: function () {
                $('#sueBscInfoFileCfgGrid').rowspan('datNm');
                $('#sueBscInfoFileCfgGrid').rowspan('uploadNm');
            },
        });
    });

    function uploadFileByUrl(_url,_name){
        if(SQ.regs.img.test(_name)){
            //SQ.imgPreview(_url);
            window.__ImgSrc = _url;
            window.__ImgTit = _name;
            window.open('<%=path%>/project/prjbscinfo/imgWinOpen.do', '', 'location=yes, width=800, height=600');
        }else{
            window.open(_url);
        }
    }

    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
        }
        return dateStr;
    }


</script>

</body>
</html>

